Technical Field
The present disclosure relates to data processing.
Description
In a data processing apparatus, it is often useful to be able to determine the origin of a call to a subroutine or function. One way to do this is to examine the link register, which contains a return address of an instruction to execute when a function or subroutine completes. However, the use of wrapper functions means that it is often a wrapper function that calls another function. This therefore says very little about the true origin of the function call. Additionally, this information is ambiguous when it comes to recursive function calls. For example, if a function x is recursive, it could be that the link register indicates that function x was called by function x. However, this gives no indication of how many times function x was recursively called or what the original origin of the function x call was. Another option for solving this problem would be for all callers to pass an identifying handle or string whenever a function is called. However, this requires cooperation from the developers of the calling code. Furthermore, multiple pieces of software could lead to ambiguities regarding exactly which function is associated with a particular label. Yet another option is to “walk” the application stack in order to determine the sequence of functions that has been called. However, this process is very time consuming It would therefore be desirable to find some way of efficiently identifying call paths.